@using WB.UI.Designer.Resources

@model WB.UI.Designer.Models.QuestionnaireListModel
@{
    ViewBag.Title = QuestionnaireController.PublicQuestionnaires;
    ViewBag.TableCssClass = "page-with-breadcrumbs";
    Layout = "Layout";

    bool? isSupportAssignFolders = Model!.IsSupportAssignFolders;
}
@section Scripts {
    @if (isSupportAssignFolders == true)
    {
        <!-- folders:css -->
        <link rel="stylesheet" href="~/css/folders.css">
        <!-- endinject -->

        <!-- folders:js -->
        <script src="~/js/folders.js"></script>
        <!-- endinject -->
    }

    <script type="text/javascript">
        var ajusteHeight = function () {
            var height = $(".public-questionnaires-breadcrumb").outerHeight();
            $(".wrapper-questionnaire-table #table-content-holder").css("bottom", height);
        };
        $(document).ready(function () {
            ajusteHeight();
        });
        $(window).resize(function () {
            ajusteHeight();
        });
    </script>
}

<ol class="breadcrumb public-questionnaires-breadcrumb">
    @foreach (var folder in Model.Breadcrumbs)
    {
        if (folder.FolderId == Model.CurrentFolderId)
        {
            <li class="active">@folder.Title</li>
        }
        else if (folder.FolderId == Guid.Empty)
        {
            <li><a href="@Url.Action("Public", new {id = (Guid?) null})">@folder.Title</a></li>
        }
        else if (folder.FolderId.HasValue)
        {
            <li>@Html.ActionLink(folder.Title, "Public", "QuestionnaireList", new {id = folder.FolderId})</li>
        }
    }
</ol>

<partial name="_QuestionnairesList" model="Model.Questionnaires"/>

@section Modal
{
    <div>
        <partial name="_IE11Modal" />
    </div>

    <div>
        <partial name="_DeleteModalDialog" />
    </div>
    <div>
        <partial name="_ExportPdfModalDialog" />
    </div>
    <div>
        <partial name="_ExportHtmlModalDialog" />
    </div>
    @if (isSupportAssignFolders == true)
    {
    <div>
        <partial name="_AssignFolderDialog" />
    </div>
    }
}
